﻿using System;
using System.Collections.Generic;
using System.EnterpriseServices;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Webdiyer.WebControls.Mvc;
using YiYiTong.Rocket.Business;
using YiYiTong.Rocket.Entity;
using YiYiTong.Rocket.Model;
using YiYiTong.Rocket.Model.Manager;
using System.Data;
using YiYiTong.Rocket.Helper;
using YiYiTong.Rocket.EFDBFirst;
using System.Data.Entity.Core.Objects;
using System.Windows.Media.Imaging;

namespace YiYiTong.Rocket.ManageWeb.Controllers
{
    public class TestController : Controller
    {
        [Description("测试页面")]
        [NoVerify]
        public ActionResult Index(string test)
        {
            string jsonData2 = "{\"enD_timE\":\"2019/1/20 00:00:00\"}";
            var aDZ_BrandMaster = JsonHelper.Deserialize<ADZ_GoodsLabel>(jsonData2);

            //ADZ_MasterEntities dbcontext = new ADZ_MasterEntities();
            //ADZ_GoodsTemp temp = new ADZ_GoodsTemp()
            //{
            //    batch = "123123",
            //    data_json = "{}",
            //    remark = "test",
            //    supplier_id = "",
            //    //create_time = DateTime.Now
            //};
            //dbcontext.ADZ_GoodsTemp.Add(temp);
            //dbcontext.SaveChanges();

            //DateTime? dt = temp.create_time;
            //ZipHelper.UnZip("D:\\1\\2.zip","");


            //var retParameter = new ObjectParameter("ret", -1);
            //var strOutPutParameter = new ObjectParameter("strOutPut", "");

            //dbcontext.proc_account_edit(9, "你是9", 1, "", retParameter, strOutPutParameter);

            //string imgUrl = YiYiTong.Rocket.Business.AliyunOssBiz.PutObjectWithDir("daneel-img");
            return View();
        }

        [Description("测试页面")]
        [NoVerify]
        public ActionResult Select()
        {
            return View();
        }


        [NoVerify]
        public ActionResult Pdf(string url)
        {
            return new Rotativa.ActionAsPdf("index", new { test = "哈哈哈" }) { FileName = "test.pdf" };
            //var rot = new Rotativa.UrlAsPdf("http://localhost:8079/dayin/fahuotongzhi/453");
            //rot.PageSize = Rotativa.Options.Size.A4;
            //return rot;
            //return View();
        }
    }
}